package com.xiaomage.parcelabledemo

import android.content.Intent
import android.support.v7.app.AppCompatActivity
import android.os.Bundle
import android.util.Log
import kotlinx.android.synthetic.main.activity_main.*

class MainActivity : AppCompatActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)
        bt_go.setOnClickListener {
            val user=User("小马哥","小帅锅")
            Log.e("传输前",user.toString())
            val bundle=Bundle()
            bundle.putParcelable("user",user)
            intent= Intent(this,Main2Activity::class.java)
            intent.putExtras(bundle)
            startActivity(intent)
        }

    }
}
